package cn.leida;

import cn.leida.base.config.LeidaConfig;
import cn.leida.ruoyi.common.annotation.DataSource;
import cn.leida.ruoyi.common.config.AppConfig;
import cn.leida.ruoyi.framework.aspectj.DataSourceAspect;
import cn.leida.ruoyi.framework.config.CaptchaConfig;
import cn.leida.ruoyi.framework.jpa.config.LeidaJPAConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author lei
 * @create 2025-03-11 18:38
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableScheduling // 定时任务
public class AdminServerApplication {

    public static void main(String[] args) {
        AppConfig.changeDB(false);
        LeidaConfig.changDev(false);
        // 初始化浏览器驱动
        ConfigurableApplicationContext ctx = SpringApplication.run(AdminServerApplication.class, args);

        System.out.println("=============修改包名=================");
        System.out.println("1.自动完成" + CaptchaConfig.class);
        System.out.println("2.必须手动" + DataSourceAspect.class + "=====" + DataSource.class.getName());


        System.out.println("============server===success=============");
        System.out.println("============server===success=============");
        System.out.println("============server===success=============");

        LeidaJPAConfig cfg = ctx.getBean(LeidaJPAConfig.class);
        System.out.println("mysql: " + cfg.mysql());


    }
}
